<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SemOpt: src/SetArgumentsList.cpp Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">SemOpt
   &#160;<span id="projectnumber">0.2alpha5-SCC</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('SetArgumentsList_8cpp.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">src/SetArgumentsList.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="SetArgumentsList_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;SetArgumentsList.h&quot;</span>
<a name="l00009"></a>00009 
<a name="l00015"></a><a class="code" href="classSetArgumentsList.html#a8e43d7a209b8ac6c5cdc5faf3227f12d">00015</a> <a class="code" href="classSetArgumentsList.html#a8e43d7a209b8ac6c5cdc5faf3227f12d" title="constructs an empty vector of SetArgumentsList">SetArgumentsList::SetArgumentsList</a>() {
<a name="l00016"></a>00016         this-&gt;list=vector&lt;SetArguments*&gt;();
<a name="l00017"></a>00017 }
<a name="l00018"></a>00018 
<a name="l00072"></a><a class="code" href="classSetArgumentsList.html#ac67a5a28311cd326d6cc448bda06ec50">00072</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsList.html#ac67a5a28311cd326d6cc448bda06ec50" title="clone all the references used in the caller set">SetArgumentsList::clone</a>(<a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>* list){
<a name="l00073"></a>00073         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>(); it!=this-&gt;<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();it++){
<a name="l00074"></a>00074                 list-&gt;<a class="code" href="classSetArgumentsList.html#ac04d83b12667ba8a9ae8990f0a789035" title="add a new SetArguments in this set">push_back</a>(*it);
<a name="l00075"></a>00075         }
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077 
<a name="l00088"></a><a class="code" href="classSetArgumentsList.html#a6d938215d6fc6faebe6f80c300a86d2d">00088</a> <a class="code" href="classSetArgumentsList.html#a8e43d7a209b8ac6c5cdc5faf3227f12d" title="constructs an empty vector of SetArgumentsList">SetArgumentsList::SetArgumentsList</a>(vector&lt;SetArguments*&gt;&amp; _list){
<a name="l00089"></a>00089         this-&gt;list=vector&lt;SetArguments*&gt;(_list);
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="comment">//TODO documentation</span>
<a name="l00093"></a>00093 SetArgumentsList::~SetArgumentsList() {
<a name="l00094"></a>00094         <span class="comment">// TODO Auto-generated destructor stub</span>
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 
<a name="l00125"></a><a class="code" href="classSetArgumentsList.html#a297fe7cde586e3584369dbeb607dbc69">00125</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsList.html#a297fe7cde586e3584369dbeb607dbc69" title="add to all the set in the SetArgumentsList the elements stored in the parameter">SetArgumentsList::addSetArgumentsToAll</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <span class="keyword">set</span>){
<a name="l00126"></a>00126         <span class="keywordflow">for</span> (<span class="keyword">auto</span> itlab=this-&gt;<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>(); itlab!=this-&gt;<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();itlab++){
<a name="l00127"></a>00127                 <span class="keywordflow">for</span> (<span class="keyword">auto</span> itset=set-&gt;begin(); itset!=<span class="keyword">set</span>-&gt;end();itset++){
<a name="l00128"></a>00128                         (*itlab)-&gt;add_Argument(*itset);
<a name="l00129"></a>00129                         <span class="comment">//itlab-&gt;add_label(*itset,(Label)((*itset)-&gt;getName()));</span>
<a name="l00130"></a>00130                         <span class="comment">//itlab-&gt;inargs()-&gt;add_Argument(*itset);</span>
<a name="l00131"></a>00131                 }
<a name="l00132"></a>00132         }
<a name="l00133"></a>00133 }
<a name="l00134"></a>00134 
<a name="l00141"></a><a class="code" href="classSetArgumentsList.html#a4d589674fadb0954b00d1b21360def36">00141</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsList.html#a4d589674fadb0954b00d1b21360def36" title="check wether or not this set is completely empty.">SetArgumentsList::empty</a>(){
<a name="l00142"></a>00142         <span class="keywordflow">return</span> this-&gt;list.empty();
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="comment">//TODO documentation</span>
<a name="l00146"></a>00146 <span class="keywordtype">void</span> SetArgumentsList::pop_back(){
<a name="l00147"></a>00147         this-&gt;list.pop_back();
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 
<a name="l00180"></a><a class="code" href="classSetArgumentsList.html#a81b8e2e59eaf34563c31231e522a19e1">00180</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsList.html#a81b8e2e59eaf34563c31231e522a19e1" title="check wether or not a SetArguments exist in the caller SetArgumentsList">SetArgumentsList::exist</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* lab)<span class="keyword">const </span>{
<a name="l00181"></a>00181         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>();it!=this-&gt;<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();it++){
<a name="l00182"></a>00182                 <span class="keywordflow">if</span> (lab==(*it)){<span class="comment">//confronto i puntatori: se sono uguali ho finito!</span>
<a name="l00183"></a>00183                         cout &lt;&lt; <span class="stringliteral">&quot;wow&quot;</span>&lt;&lt;endl;
<a name="l00184"></a>00184                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00185"></a>00185                 }
<a name="l00186"></a>00186         }
<a name="l00187"></a>00187         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>();it!=this-&gt;<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();it++){
<a name="l00188"></a>00188                 <span class="keywordflow">if</span> (lab-&gt;<a class="code" href="classSetArguments.html#a0c4a6994f83dfccf2d34022cb132b782" title="verify that 2 SetArguments are equal">equal</a>(**it)==<span class="keyword">true</span>){<span class="comment">//confronto le strutture: se sono uguali ho finito!</span>
<a name="l00189"></a>00189                         cout &lt;&lt; <span class="stringliteral">&quot;wow2&quot;</span>&lt;&lt;endl;
<a name="l00190"></a>00190                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00191"></a>00191                 }
<a name="l00192"></a>00192         }
<a name="l00193"></a>00193         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195 
<a name="l00201"></a><a class="code" href="classSetArgumentsList.html#ae4695dd5a00286692e6b7903ec017f18">00201</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArgumentsList.html#ae4695dd5a00286692e6b7903ec017f18" title="the SetArguments positioned to i index">SetArgumentsList::at</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const</span>{
<a name="l00202"></a>00202         <span class="keywordflow">return</span> this-&gt;list.at(i);
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 
<a name="l00214"></a><a class="code" href="classSetArgumentsList.html#ac04d83b12667ba8a9ae8990f0a789035">00214</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsList.html#ac04d83b12667ba8a9ae8990f0a789035" title="add a new SetArguments in this set">SetArgumentsList::push_back</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <span class="keyword">set</span>){
<a name="l00215"></a>00215         this-&gt;list.push_back(<span class="keyword">set</span>);
<a name="l00216"></a>00216 }
<a name="l00217"></a>00217 
<a name="l00221"></a><a class="code" href="classSetArgumentsList.html#a65c7e6cf46f3e6f8c5e849aa9506557e">00221</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsList.html#a65c7e6cf46f3e6f8c5e849aa9506557e">SetArgumentsList::clearAll</a>(){
<a name="l00222"></a>00222         this-&gt;list.clear();
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224 
<a name="l00230"></a><a class="code" href="classSetArgumentsList.html#ab1789b23810da76e65fd902183529638">00230</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classSetArgumentsList.html#ab1789b23810da76e65fd902183529638" title="the size of this set of SetArguments">SetArgumentsList::size</a>()<span class="keyword"> const</span>{
<a name="l00231"></a>00231         <span class="keywordflow">return</span> this-&gt;list.size();
<a name="l00232"></a>00232 }
<a name="l00233"></a>00233 
<a name="l00246"></a><a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe">00246</a> SetArgumentsListIterator <a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">SetArgumentsList::begin</a>()<span class="keyword"> const</span>{
<a name="l00247"></a>00247         <span class="keywordflow">return</span> SetArgumentsListIterator(this-&gt;list.begin());
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 
<a name="l00262"></a><a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736">00262</a> SetArgumentsListIterator <a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">SetArgumentsList::end</a>()<span class="keyword"> const</span>{
<a name="l00263"></a>00263         <span class="keywordflow">return</span> SetArgumentsListIterator(this-&gt;list.end());
<a name="l00264"></a>00264 }
<a name="l00265"></a>00265 
<a name="l00278"></a><a class="code" href="SetArgumentsList_8cpp.html#a9413b400ac7bc89c9652ebe2c0b3a81f">00278</a> ostream&amp; <a class="code" href="Argument_8cpp.html#a76ef732a0021f3ac6698582cf94a079e">operator&lt;&lt;</a>(ostream&amp; stream, <span class="keyword">const</span> <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>&amp; lablist){
<a name="l00279"></a>00279         stream &lt;&lt; <span class="stringliteral">&quot;{ &quot;</span>;
<a name="l00280"></a>00280         <span class="keywordflow">if</span> (lablist.<a class="code" href="classSetArgumentsList.html#ab1789b23810da76e65fd902183529638" title="the size of this set of SetArguments">size</a>()!=0){
<a name="l00281"></a>00281                 <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=lablist.<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>();it!=lablist.<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();it++){
<a name="l00282"></a>00282                         stream &lt;&lt; **it &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;
<a name="l00283"></a>00283                 }
<a name="l00284"></a>00284         }
<a name="l00285"></a>00285         stream &lt;&lt; <span class="stringliteral">&quot; }&quot;</span>;
<a name="l00286"></a>00286         <span class="keywordflow">return</span> stream;
<a name="l00287"></a>00287 }
<a name="l00288"></a>00288 
<a name="l00309"></a><a class="code" href="SetArgumentsList_8cpp.html#a502928eeb2f29235e5a53b050fe86a92">00309</a> <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a> <a class="code" href="SetArgumentsList_8cpp.html#a502928eeb2f29235e5a53b050fe86a92" title="overriding of the operator +.">operator+</a>(<a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a> a, <span class="keyword">const</span> <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>&amp; b){
<a name="l00310"></a>00310         <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a> result=<a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>(a);
<a name="l00311"></a>00311         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=b.<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>();it!=b.<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();it++){
<a name="l00312"></a>00312                 result.<a class="code" href="classSetArgumentsList.html#ac04d83b12667ba8a9ae8990f0a789035" title="add a new SetArguments in this set">push_back</a>(*it);
<a name="l00313"></a>00313         }
<a name="l00314"></a>00314         <span class="keywordflow">return</span> result;
<a name="l00315"></a>00315 }
<a name="l00316"></a>00316 
<a name="l00322"></a>00322 <span class="keywordtype">void</span> SetArgumentsList::swap(<a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>&amp; first, <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>&amp; second){
<a name="l00323"></a>00323         <span class="keyword">using</span> std::swap;
<a name="l00324"></a>00324         swap(first.list,second.list);
<a name="l00325"></a>00325 }
<a name="l00326"></a>00326 
<a name="l00327"></a>00327 <span class="comment">//TODO documentation</span>
<a name="l00328"></a>00328 <span class="comment">//TODO testing</span>
<a name="l00329"></a>00329 <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a>&amp; SetArgumentsList::operator=(<a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a> rhs){
<a name="l00330"></a>00330         SetArgumentsList::swap(*<span class="keyword">this</span>,rhs);
<a name="l00331"></a>00331         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00332"></a>00332 }
<a name="l00333"></a>00333 
<a name="l00334"></a>00334 
<a name="l00341"></a><a class="code" href="classSetArgumentsList.html#aba764b29bae21920d12b67ef8e466fae">00341</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsList.html#aba764b29bae21920d12b67ef8e466fae" title="checks if the 2 SetArgumentsList stored the same SetArguments.">SetArgumentsList::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSetArgumentsList.html" title="Class representing a vector of labelling assignment.">SetArgumentsList</a> &amp;other)<span class="keyword"> const</span>{
<a name="l00342"></a>00342         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArgumentsList.html#ab1789b23810da76e65fd902183529638" title="the size of this set of SetArguments">size</a>()!=other.<a class="code" href="classSetArgumentsList.html#ab1789b23810da76e65fd902183529638" title="the size of this set of SetArguments">size</a>()){
<a name="l00343"></a>00343                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00344"></a>00344         }
<a name="l00345"></a>00345         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsList.html#a3104fc77d6f9353b8fb2fed4737b4dbe" title="return the first element of the list">begin</a>();it!=this-&gt;<a class="code" href="classSetArgumentsList.html#a6aff07396c1207e69a9a98e51b9de736" title="return the last element of the list">end</a>();it++){
<a name="l00346"></a>00346                 <span class="keywordflow">if</span> (other.<a class="code" href="classSetArgumentsList.html#a81b8e2e59eaf34563c31231e522a19e1" title="check wether or not a SetArguments exist in the caller SetArgumentsList">exist</a>(*it)==<span class="keyword">false</span>){
<a name="l00347"></a>00347                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00348"></a>00348                 }
<a name="l00349"></a>00349         }
<a name="l00350"></a>00350         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00351"></a>00351 }
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="SetArgumentsList_8cpp.html">SetArgumentsList.cpp</a>      </li>

    <li class="footer">Generated on Thu Oct 24 2013 17:38:30 for SemOpt by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
